package main

import "fmt"
import "errors"

func test(a, b int) (result int, err error) {
	err = nil
	if b == 0 {
		err = errors.New("对不起,0无法做除数,请检查")
	} else {
		result = a / b
	}

	return
}
func main() {
	result, err := test(10, 5)
	if err != nil {
		fmt.Println("err=", err)
	} else {
		fmt.Println("result=", result)
	}
}
